package com.yu.waterstation.system.modules.system.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.waterstation.system.modules.system.mapper.AdminLogMapper;
import com.yu.waterstation.common.entity.system.AdminLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class AdminLogService   {

    @Resource
    private AdminLogMapper adminLogMapper;

    public Page<AdminLog> getAdminLogByPage(int pageNo, int pageSize)   {
        return adminLogMapper.selectPage(new Page<>(pageNo, pageSize),
                new QueryWrapper<AdminLog>().orderByDesc("timestamp"));
    }
}
